<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="copyright" content="http://www.appcms.org" />
<link rel="stylesheet" href="skin/base.css">
<link rel="stylesheet" href="skin/company_show.css">
<script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/zy_slide.js"></script>
<script src="js/config.js"></script>
</head>
<body>
<div id="content" class="loading"> 
  <!--
  <div class="company_item">
    <div class="head">
      <div class="img"></div>
    
      <h3>标题</h3>
      <div class="w">
        <div class="img"></div>
        <ul>
          <li>主营</li>
          <li>人气</li>
          <li>好评率</li>
          <li>点评数</li>
        </ul>
      </div>
    </div>
    
    <ul class="tels">
      <li class="tel">联系电话</li>
      <li class="ads">地址</li>
    </ul>
    <div class="com">
      <h3>图片<span>(2)</span></h3>
      <ul>
        <li><img/></li>
        <li><img/></li>
      </ul>
    </div>
    <div class="com hidden" onClick="show(this)">
      <h3>商户简介</h3>
      <div class="txt"> 　各OPO所在医院必须制订潜在捐献人识别与筛选医学标准，建立标准的人体捐献器官获取技术规范，配备专业人员和设备，规范行为，完善文书记录，以确保获取器官的质量。OPO获取的捐献器官必须通过中国器官分配系统进行科学、规范、公平、公正、公开的分配。任何机构、组织和个人不得在器官分配系统外擅自分配捐献器官，确保捐献器官的溯源性。 </div>
      <span class="md"></span> 
	</div>
   
    <div id="comment">
      <h3>点评<span>(2)</span></h3>
      <div class="item">
        <div class="avatar" ></div>
        <div class="talkcontent">
          <div class="nick">传朴</div>
          <div class="date"><span class="l">1-4 22:22:56</span><span class="r"><em>☆☆☆</em>☆☆</span></div>
          <p>难男男女女男男女女男男女女男男女女难男男女女难你奶奶</p>
        </div>
      </div>
    </div>
    
  </div>
 --> 
</div>
</body>
<script>
    	zy_init();
		var page = 1;
		var photo_b = [];
		var tel;
		function ok(msg){
			uexWindow.toast("0","5",msg,2000);
			page = 1;
			getMain(0);
		}
	
		function show(t){
			if(t.className=='com block'){			
				t.className ='com';
			}else{
				t.className ='com block';
			}
		}
		
		function Empty(){
			tel='';
			$$('content').innerHTML='';
		}
		
		function getMain(t){
			var url = app_path+'index.php?m=iappYp&c=app&a=show&t=iappYp_company&id='+localStorage['company_id'];
			uexXmlHttpMgr.open(t,'get',url,"8000");
			uexXmlHttpMgr.send(t);
		}
		
		function comment(){
			var url= app_api+'&a=commentlist&id='+localStorage['company_id']+'&catid='+localStorage['company_catid']+'&page='+page;
			uexXmlHttpMgr.open(1,'get',url,"8000");
			uexXmlHttpMgr.send(1);
		}
			
		function jump_coupons(id){
			localStorage['coupons_id']=id;
			uexWindow.open('coupons_show','0','coupons_show.html','2','', '',0);
		}
		
		function jump_details(windowname,url){
			uexWindow.open(windowname, '0', url, '2', '', '', 0);
		}
		
		function CallShow(t){
			tel=t;
			uexWindow.cbActionSheet = function(opId,dataType,data){
				if(dataType==2){
					if(data==0){uexCall.call(tel);}
				}
			}
			uexWindow.actionSheet('电话号码：'+tel,'取消',['拨打电话']);
		}
		
		function star(k){
			var html = '';
			html += '<em>';
			for (i = 0; i <k; i++) {
				html += '☆';
			}
			html += '</em>';
			for (i = 0; i <5-k; i++) {
				html += '☆';
			}
			return html;
		}
	
		window.uexOnload = function(type){
			if (!type) {
				uexWindow.setBounce("1");
				uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
		　　　　	uexWindow.setBounceParams("1",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"","pullToReloadText":"上拉加载更多","releaseToReloadText":"释放加载","loadingText":"加载中，请稍等"}');
		　　　　	uexWindow.showBounceView("0","#f3f3f3","1");
		　　　　	uexWindow.notifyBounceEvent("0","1");
				uexWindow.showBounceView("1","#f3f3f3","1");
	　　　　		uexWindow.notifyBounceEvent("1","1");
				uexWindow.onBounceStateChange=function(t,s){
					if(s=="2"){
						if(t=="0"){
							page =1;
							getMain(0);
						}else if(t=="1"){
							comment();	
						}
		　　　　　　}
		　　　　}
		
				uexXmlHttpMgr.onData = function(opId, status, data){
					uexWindow.resetBounceView(opId);
					uexXmlHttpMgr.close(opId);
					if(opId==0){
						if (status==1){
							data=JSON.parse(data);
							var info = data['data'];
							var photo = data['photo'];
							if(data.length!=0){
								localStorage['p_title']=info['title'];
								localStorage['p_url']= info['url'];
								localStorage['p_type']= 'company_show';
								localStorage['p_catid'] = localStorage['company_catid'];
					            localStorage['p_id'] = localStorage['company_id'];
								
								localStorage['map_x']=info['x'];
								localStorage['map_y']= info['y'];
								
								
								
								var contentHtml='<div class="company_item">'+
												'<div class="head">'+
												'  <h3>'+info['title']+'</h3>'+
												'  <div class="w">'+
												'	<div class="img">'+
												'      <div class="loadimg">'+
								                '        <img src="'+info['thumb']+'" class="hide" onload="this.className=\'\'" />'+
								                '      </div>'+
												'   </div>'+
												'	<ul>'+
												'	  <li>主营:'+info['operate']+'</li>'+
												'	  <li>人气:'+info['hits']+'</li>'+
												'	  <li>好评率:'+info['comment_proportion']+'</li>'+
												'	  <li>点评数:'+info['comment_total']+'</li>'+
												'	</ul>'+
												'  </div>'+
												'</div>';
												
								contentHtml +='<ul class="tels">'+
								  			  '<li class="tel" ontouchstart="zy_touch(\'down\')" onclick="CallShow(\''+info['tel']+'\')">'+info['tel']+'</li>'+
								  			  '<li class="ads" ontouchstart="zy_touch(\'down\')" onclick="jump_details(\'map\',\'map.html\')">' + info['address'] + '</li>'+
								  			  '</ul>';
												
											
								if(photo['b'].length>0){
									var photo_m=photo['m'];
									photo_b=photo['b'];
									contentHtml+='<div class="com"><h3>图片<span>('+photo_b.length+')</span></h3><ul>';
									if(photo_b[0]){
										contentHtml+='<li onclick="uexImageBrowser.open(photo_b,0,1);" > <img src="'+photo_m[0]+'" class="hide" onload="this.className=\'\'" /></li>';
									}
									if(photo_b[1]){
										contentHtml+='<li onclick="uexImageBrowser.open(photo_b,1,1);" > <img src="'+photo_m[1]+'" class="hide" onload="this.className=\'\'" /></li>';
									}
									contentHtml+='  </ul></div>';
								}
								
								if(trim(info['content'])!=''){
									contentHtml+='<div class="com hidden" onClick="show(this)">'+
												 '  <h3>商户简介</h3>'+
												 '  <div class="txt">'+info['content']+'</div>'+
											 	 '  <span class="md"></span>'+
												 '</div>';
								}
								contentHtml+='<div id="comment"><h3>点评<span></span></h3></div>';
								contentHtml+='</div>';
								
								$$('content').innerHTML=contentHtml;
								$$('content').className='';
								
								comment();
								
							}else{					
								uexWindow.alert('','商家不存在','关闭');
								uexWindow.evaluateScript('company_show',0,'uexWindow.close(-1)');
							}						
						}else if(status==-1){
							$$('content').className='errer';
							uexWindow.toast("0","5",'加载失败!',1000);
						}
					}else if (opId == 1) {
						if (status == 1) {
							data=JSON.parse(data);
							if(data['status']=='OK'){
								for(k in data['data']){
									var div = document.createElement("div");
									div.className='item';
									var html ='';
									var avatar = ''
									if(data['data'][k]['avatar']!=''){
										avatar = '<img src="'+data['data'][k]['avatar']+'">'
									}
									html +='<div class="avatar" >'+avatar+'</div>'+
									       '   <div class="talkcontent">'+
										   '   	   <div calss="nick">'+data['data'][k]['nick']+'</div>'+
										   '       <div class="date"><span class="l">'+data['data'][k]['addtime']+'</span><span class="r">'+star(data['data'][k]['direction'])+'</span></div>'+
										   '       <p>'+data['data'][k]['content']+'</p>'+
										   '   </div>'+
					    				   '</div>';
									div.innerHTML = html;
									$$('comment').appendChild(div);
								}
							}else{
								uexWindow.toast("0","5",data['msg'],1000);
							}
							page++;
						}else if(status==-1){
							uexWindow.toast("0","5",'加载失败!',1000);
						}
					} 
				}
				getMain(0);
			}
		}
	</script>
</html>